
<template>
  <div class="app-container">
    <div class="title-flex">
      <div>消息发送记录</div>
    </div>
    <div>
      <el-table
          border

          ref="multipleTableRef"
          :data="tableData"
          default-expand-all
          style="width: 100%"
      >
<!--        <el-table-column type="selection" :selectable="selectable" width="55" />-->
<!--        <el-table-column label="职工号" width="70">-->
<!--          <template #default="scope">{{ scope.row.id }}</template>-->
<!--        </el-table-column>-->
        <el-table-column property="serialNumber" label="序号" width="100"/>
        <el-table-column property="title" label="通知业务类型" width="160"/>
        <el-table-column property="name" label="接收人" width="130"/>
        <el-table-column property="sendTime" label="发送时间"  width="200"/>
        <el-table-column property="content" label="发送内容" />
        <el-table-column property="readName" label="已读状态" width="150"/>
<!--        <el-table-column fixed="right" label="操作" min-width="120">-->
<!--          <template #default>-->
<!--            <el-button link type="primary" size="small" @click="dialogFormVisible = true">-->
<!--              操作-->
<!--            </el-button>-->
<!--            <el-button link type="primary" size="small"  @click="open">删除</el-button>-->
<!--          </template>-->
<!--        </el-table-column>-->
      </el-table>
    </div>

    <div class="example-pagination-block">
      <el-pagination
          layout="->,prev, pager, next, total"
          :total="count"
          currentPage1="10"
          @current-change="handleCurrentChange"
      />
    </div>
  </div>
</template>
<script lang="ts" setup>
import {sysMessageList} from "@/api/researcherNavApi/xtxxApi"
const count = ref('0')
import {DrawerProps, ElMessage, ElMessageBox} from "element-plus";
import {onMounted} from "vue";

const getListParme = ref({
  page:'1',
  pageSize:'10',
})
const getList = function (){
  sysMessageList(getListParme.value)
      .then((res)=>{
        tableData.value = res.data.list
        count.value = res.data.count

      })
}

const handleCurrentChange = (val: string) => {
  getListParme.value.page = val
  sysMessageList(getListParme.value)
      .then((res)=>{
        tableData.value = res.data.list
        count.value = res.data.count
      })
  console.log(`current page: ${val}`)
}

onMounted(()=> {
  getList()
})
const tableData =ref([])

</script>

<style scoped lang="scss">
.title-flex{
  display: flex;
  justify-content: space-between;
  text-align: center;

}
</style>